<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 朝上的小三角,border-top不设置，左右两边的border颜色为透明 */
        div {
            width: 0;
            height: 0;
            border-bottom: 50px solid red;
            border-right: 50px solid transparent;
            border-left: 50px solid transparent;
        }
    </style>
</head>

<body>
    <h1>实现一个三角形</h1>
    <div></div>
</body>

</html>